
import axios from 'axios';

/**
 * 秒杀商品
 */
export class SkillCommodityService {
    // 分页查询列表
    static findSkillCommoditys (queryParams) {
        return axios({
            url: '/mall/skill/SkillCommodity/findSkillCommoditys',
            method: 'POST',
            data: queryParams
        });
    }

    //根据ID查询指定的秒杀商品
    static findSkillCommodity (skillCommodityId) {
        const query = {
            skillCommodityId
        }
        return axios({
            url: '/mall/skill/SkillCommodity/findSkillCommodity',
            method: 'POST',
            params: query,
        });
    }

    //根据ID查询指定的秒杀商品(包含外键名称)
    static findSkillCommodityForView (skillCommodityId) {
        const query = {
            skillCommodityId
        }
        return axios({
            url: '/mall/skill/SkillCommodity/findSkillCommodityForView',
            method: 'POST',
            params: query,
        });
    }

    //根据ID查询指定的秒杀商品(包含外键名称)
    static findSkillCommodityForEdit (skillCommodityId) {
        const query = {
            skillCommodityId
        }
        return axios({
            url: '/mall/skill/SkillCommodity/findSkillCommodityForEdit',
            method: 'POST',
            params: query,
        });
    }

    //根据ID查询指定的秒杀商品(只提取ID 和 Name)
    static findSkillCommoditysWithIdNameById (skillCommodityId) {
        const query = {
            skillCommodityId
        }
        return axios({
            url: '/mall/skill/SkillCommodity/findSkillCommoditysWithIdNameById',
            method: 'POST',
            params: query,
        });
    }

    //根据名称查询秒杀商品集合(只提取ID 和 Name)
    static findSkillCommoditysWithIdNameByName (skillCommodityName) {
        const query = {
            skillCommodityName
        }
        return axios({
            url: '/mall/skill/SkillCommodity/findSkillCommoditysWithIdNameByName',
            method: 'POST',
            params: query,
        });
    }

    //新增保存秒杀商品
    static saveSkillCommodity (skillCommodity) {
        const query = {}
        return axios({
            url: '/mall/skill/SkillCommodity/saveSkillCommodity',
            method: 'POST',
            params: query,
            data: skillCommodity
        });
    }

    //修改保存秒杀商品
    static updateSkillCommodity (skillCommodity) {
        const query = {}
        return axios({
            url: '/mall/skill/SkillCommodity/updateSkillCommodity',
            method: 'POST',
            params: query,
            data: skillCommodity
        });
    }

    //根据ID查询指定的秒杀商品(只提取ID 和 Name)
    static deleteSkillCommodity (skillCommodityId) {
        const query = {
            skillCommodityId
        }
        return axios({
            url: '/mall/skill/SkillCommodity/deleteSkillCommodity',
            method: 'POST',
            params: query,
        });
    }
}
